from common.excel import OldExcel, NewExcel, NewExcelcopy


def get_reader(srcfile='../../lib/一手app.xlsx'):
    reader = None
    if srcfile.endswith('.xls'):
        reader = NewExcel.Reader()
        reader.openexcel(srcfile)
        return reader
    elif srcfile.endswith('.xlsx'):
        reader = NewExcelcopy.Reader()
        reader.open_excel(srcfile)
        return reader


if __name__ == '__main__':
    reader = get_reader('../../lib/cases/maihuomao.xls')
    sheets = reader.get_sheets()
    for sheet in sheets:
        reader.set_sheet(sheet)
        reader.readline()
